package org.td.engine;

import org.td.engine.entity.MonsterClass;

import java.util.ArrayList;
import java.util.List;

public class MonsterWave {
    private List<MonsterClass> classList;
    private int index;
    private float delay;

    public MonsterWave(WaveData waveData, int[] units) {
        classList = new ArrayList<MonsterClass>(units.length);
        for (int i : units) {
            classList.add(waveData.getClassById(i));
        }
        delay = waveData.getDelay();
        index = 0;
    }

    public float getDelay() {
        return delay;
    }

    public MonsterClass getNextMonster() {
        return classList.get(index++);
    }

    public int getRemainingMonsters() {
        return classList.size() - index;
    }
}
